<?php
if(isset($_POST['out']))
{	
	$mess="已退出";
	header("location:login.php?mess=$mess");
}
if(isset($_POST['reg']))
{
	header("location:register.php");
}
$uid=$_GET['uid'];

include_once 'mysql_connect.php';

$csubmit=$_POST['csubmit'];
$c_uid=$_GET['c_uid'];
if($csubmit=='修改密码')
{	
	$message="$c_uid,password";
	header("location:show.php?change_infor=$message");
}
if($csubmit=='修改昵称')
{
	$message="$c_uid,username";
	header("location:show.php?change_infor=$message");
}
if($csubmit=='重置头像')
{
	$message="$c_uid,headimg";
	header("location:show.php?change_infor=$message");
}
if($csubmit=='论坛资料')
{
	$message="$c_uid";
	header("location:bbs.php?uid=$message");
}




$member=mysql_query(" SELECT * FROM `bbs_member` WHERE `uid`='$uid' ");
$member=mysql_fetch_array($member);
$infor=mysql_query(" SELECT * FROM `bbs_member_infor` WHERE `uid`='$uid' ");
$infor=mysql_fetch_array($infor);
//$forum=mysql_query(" SELECT * FROM `bbs_forum` WHERE `uid`='$uid' ");
//$forum=mysql_fetch_array($forum);

date_default_timezone_set('Asia/Shanghai');//亚洲上海时区
$time=$member['regtime'];
$time=date("Y-m-d",$time);
$username=$member['username'];
$class=$member['class'];
$regip=$member['regip'];
$headimg=$infor['photo'];
$topics=$infor['topics'];
$rand_img="photo/center_".rand(0,9).".jpg";
$sex=$infor['sex'];

switch($sex)
{
	case 1: $sex="男生"; break;
	case 2: $sex="女生"; break;
	case 3: $sex="神仙"; break;
	case 4: $sex="妖魔"; break;
	
}

switch($class)
{
	case 1: $class='会员'; break;
	case 2: $class='高级会员'; break;
	case 3: $class='白金会员'; break;
	case 4: $class='版主'; break;
	case 5: $class='管理员'; break;
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $username?> 的个人空间</title>
</head>

<body>
<form action="my_zone.php" method="post">
<input type="submit" name="out" value="退出" />
<input type="submit" name="reg" value="注册" />
</form>
<hr />
<form action="my_zone.php?c_uid=<?php echo $uid;?>" method="post">
<table border="1"  >
  <tr>
    <td colspan="10" height="30"><img src="photo/my_zone.png" /></td>
  </tr>
  <tr>
    <td><input type="submit" name="csubmit" value="修改密码"/></td>
    <td><input type="submit" name="csubmit" value="修改昵称" /></td>
    <td><input type="submit" name="csubmit" value="重置头像" /></td>
    <td><input type="submit" name="csubmit" value="论坛资料" /></td>
  </tr>
  <tr>
    <td><img src=<?php echo $headimg; ?>  width="150" height="150"/></td>
	<td colspan="3" rowspan="9" >&nbsp;</td>
  </tr>
  <tr>
    <td >用户：<?php echo $username ;?></td>
  </tr>
  <tr>
    <td >用户ID：<?php echo $uid;?></td>
  </tr>
  <tr>
    <td >贴数：<?php echo $topics;?></td>
  </tr>
  <tr>
    <td >性别：<?php echo $sex ;?></td>
  </tr>
  <tr>
    <td >Member：<?php echo $class ;?></td>
  </tr>
  <tr>
    <td >注册时间：<?php echo  $time;?></td>
  </tr>
</table>
</form>
</body>
</html>